import request from '@/utils/request'

// todo 渲染车型列表
export function getCarListData() {
  return request({
    url: '/manager/truckType/simple',
    method: 'get'
  })
}

// todo 添加车型
export function addCar(data) {
  return request({
    url: '/manager/truckType',
    method: 'post',
    data
  })
}

// todo 删除车型
export function delCarApi(id) {
  return request({
    url: `/manager/truckType/${id}`,
    method: 'delete'
  })
}

// todo 获取车辆信息详情
export function getCarDetailApi(id) {
  return request({
    url: `/manager/truckType/${id}`,
    method: 'get'
  })
}

// todo 编辑更新车型
export function updateCarApi(data) {
  return request({
    url: `/manager/truckType/${data.id}`,
    method: 'put',
    data
  })
}

// todo 车型分页数据
export function getCarApi(params) {
  return request({
    url: '/manager/truckType/page',
    method: 'get',
    params
  })
}
